/*
* pps_bom
*/
package com.pitop.assembly.api;

import com.pitop.assembly.entity.AssemblyMaterial;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 构成组件的物料 api请求熔断器
 *
 * @author berton
 */
@FeignClient(value = "pps-cloud-provider", fallback = AssemblyMaterialFeignApiImpl.class)
public interface AssemblyMaterialFeignApi {
    /**
     * 查询AssemblyMaterial一个详情信息
     *
     * @param id
     * @param assemblyCode 组件编码
     * @param materialCode 物料编码
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/load")
    AssemblyMaterial load(@RequestParam("id") Long id, @RequestParam("assemblyCode") String assemblyCode, @RequestParam("materialCode") String materialCode);

    /**
     * 查询AssemblyMaterial一个详情信息
     *
     * @param id
     * @param assemblyCode 组件编码
     * @param materialCode 物料编码
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/get")
    AssemblyMaterial get(@RequestParam("id") Long id, @RequestParam("assemblyCode") String assemblyCode, @RequestParam("materialCode") String materialCode);

    /**
     * 根据条件id查询AssemblyMaterial一个详情信息
     *
     * @param id
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/load/id/{id}")
    AssemblyMaterial loadById(@RequestParam("id") Long id);

    /**
     * 根据条件assemblyCode查询AssemblyMaterial一个详情信息
     *
     * @param assemblyCode 组件编码
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/load/assemblyCode/{assemblyCode}")
    AssemblyMaterial loadByAssemblyCode(@RequestParam("assemblyCode") String assemblyCode);

    /**
     * 根据条件materialCode查询AssemblyMaterial一个详情信息
     *
     * @param materialCode 物料编码
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/load/materialCode/{materialCode}")
    AssemblyMaterial loadByMaterialCode(@RequestParam("materialCode") String materialCode);

    /**
     * 根据条件id查询AssemblyMaterial一个详情信息
     *
     * @param id
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/get/id/{id}")
    AssemblyMaterial getById(@RequestParam("id") Long id);

    /**
     * 根据条件assemblyCode查询AssemblyMaterial一个详情信息
     *
     * @param assemblyCode 组件编码
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/get/assemblyCode/{assemblyCode}")
    AssemblyMaterial getByAssemblyCode(@RequestParam("assemblyCode") String assemblyCode);

    /**
     * 根据条件materialCode查询AssemblyMaterial一个详情信息
     *
     * @param materialCode 物料编码
     * @return AssemblyMaterial
     */
    @GetMapping(value = "/assemblyMaterial/get/materialCode/{materialCode}")
    AssemblyMaterial getByMaterialCode(@RequestParam("materialCode") String materialCode);

    /**
     * 删除AssemblyMaterial
     */
    @DeleteMapping("/assemblyMaterial/delete")
    void delete(@RequestParam("id") Long id, @RequestParam("assemblyCode") String assemblyCode, @RequestParam("materialCode") String materialCode);


    /**
     * 查询AssemblyMaterial信息集合
     *
     * @return 分页对象
     */
    @PostMapping(value = "/assemblyMaterial/list")
    List<AssemblyMaterial> list(@RequestBody AssemblyMaterial assemblyMaterial, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 查询AssemblyMaterial信息集合
     *
     * @return 分页对象
     */
    @GetMapping(value = "/assemblyMaterial/list/by")
    List<AssemblyMaterial> listByPk(@RequestParam("id") Long id, @RequestParam("assemblyCode") String assemblyCode, @RequestParam("materialCode") String materialCode, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 统计AssemblyMaterial信息数量根据主键
     *
     * @return 总条数
     */
    @GetMapping(value = "/assemblyMaterial/count/by")
    Integer count(@RequestParam("id") Long id, @RequestParam("assemblyCode") String assemblyCode, @RequestParam("materialCode") String materialCode);

    /**
     * 统计AssemblyMaterial信息数量
     *
     * @return 总条数
     */
    @PostMapping(value = "/assemblyMaterial/count")
    Integer count(@RequestBody AssemblyMaterial assemblyMaterial);


    /**
     * 创建AssemblyMaterial
     *
     * @return AssemblyMaterial
     */
    @PostMapping("/assemblyMaterial/build")
    AssemblyMaterial build(@RequestBody AssemblyMaterial assemblyMaterial);


    /**
     * 修改AssemblyMaterial
     *
     * @return AssemblyMaterial
     */
    @PutMapping("/assemblyMaterial/modify")
    AssemblyMaterial modify(@RequestBody AssemblyMaterial assemblyMaterial);


}
